#-*- coding:utf-8 -*-
# ab.py
import cv2
import numpy as np
def test(fileName):
     print 'result'+fileName+'ddd'
     previousImage=cv2.imread(fileName)
     cv2.imwrite("./res.jpg", previousImage)
     return

def creatSquare(xValue,yValue,sideLength,operationType):
     print xValue
     print yValue
     print sideLength
     print operationType

     fileName="./temp.jpg"
     img=cv2.imread(fileName)
     print 'read over'

     if (operationType==1):
         cv2.rectangle(img,(xValue,yValue),(xValue+sideLength,yValue+sideLength),(255,255,255),-1)#front white
     elif (operationType==2):
         cv2.rectangle(img,(xValue,yValue),(xValue+sideLength,yValue+sideLength),(0,0,0),-1)#back black
     else :
         cv2.rectangle(img,(xValue,yValue),(xValue+sideLength,yValue+sideLength),(55,255,155),2)#none none

     print 'rectangle done'
     cv2.imwrite(fileName,img)
     print 'save over'
     return 
